import request from '@/utils/request'

export const getGeneralCouponList = () => request({
  url: '/universalCoupon/list',
  method: 'GET'
})

export const delCoupon = id => request({
  url: `/universalCoupon/delete/${id}`,
  method: 'DELETE'
})

export const addCoupon = data => request({
  url: '/universalCoupon/add',
  method: 'POST',
  data
})

export const getCouponDetail = (id) => request({
  url: `/universalCoupon/list/${id}`,
  method: 'GET'
})

// 更新
export const editCouponDetail = (data) => request({
  url: `/universalCoupon/update/${data.id}`,
  data,
  method: 'PATCH'
})

// 获取店铺优惠劵
export const getStoreCoupon = () => request({
  url: '/storecoupon/list',
  method: 'GET'
})
